package org.example;

import io.seata.core.context.RootContext;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

@Slf4j
@Service
public class DeptServiceImp implements  DeptService{


    @Autowired
    private DeptRepository deptRepository;
    @Transactional
    public int updateDept(Dept dept) {
        System.out.println("xid:"+RootContext.getXID());
        return deptRepository.updateValue(dept.getId(),dept.getDeptName());
    }
}
